﻿using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient.UI
{
	// Token: 0x02001889 RID: 6281
	internal class BattleSkillHandler : DlgHandlerBase
	{
		// Token: 0x170039D1 RID: 14801
		// (get) Token: 0x06010582 RID: 66946 RVA: 0x003F8C60 File Offset: 0x003F6E60
		public bool IsAwakeSlotSettingOn
		{
			get
			{
				XOptionsDocument specificDocument = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
				bool flag = specificDocument != null;
				return !flag || specificDocument.GetValue(XOptionsDefine.OD_Awake_Slot) != 0;
			}
		}

		// Token: 0x06010583 RID: 66947 RVA: 0x003F8C98 File Offset: 0x003F6E98
		public BattleSkillHandler()
		{
			this._DestroyShowSkillFx = new XTimerMgr.ElapsedEventHandler(this.DestroyShowSkillFx);
		}

		// Token: 0x06010584 RID: 66948 RVA: 0x003F8D18 File Offset: 0x003F6F18
		protected override void Init()
		{
			base.Init();
			this._showSkillNum = 0;
			Transform transform = base.PanelObject.transform.Find("LevelTpl");
			bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB;
			if (flag)
			{
				this.m_LevelPool.SetupPool(transform.parent.gameObject, transform.gameObject, 16U, false);
			}
			else
			{
				transform.gameObject.SetActive(false);
			}
			this.m_buttons = new BattleSkillHandler.XSkillButton[XBattleSkillDocument.Total_skill_slot];
			int num = 0;
			while ((uint)num < XBattleSkillDocument.Total_skill_slot)
			{
				this.m_buttons[num] = new BattleSkillHandler.XSkillButton(base.PanelObject, num);
				num++;
			}
			this.m_sirControl = XSingleton<XUpdater.XUpdater>.singleton.GameSirControl;
			this._doc = XDocuments.GetSpecificDocument<XBattleSkillDocument>(XBattleSkillDocument.uuID);
			this._doc.BattleView = this;
			this._doc.Init();
			this._skill_doc = XDocuments.GetSpecificDocument<XSkillTreeDocument>(XSkillTreeDocument.uuID);
			this.mSkillSets = new List<string[]>();
			string[] andSeparateValue = XSingleton<XGlobalConfig>.singleton.GetAndSeparateValue("GameSirKeyCodes", XGlobalConfig.ListSeparator);
			bool flag2 = andSeparateValue == null || andSeparateValue.Length == 0;
			if (flag2)
			{
				this.mSkillSize = 0;
			}
			else
			{
				this.mSkillSize = andSeparateValue.Length;
				for (int i = 0; i < this.mSkillSize; i++)
				{
					this.mSkillSets.Add(andSeparateValue[i].Split(XGlobalConfig.SequenceSeparator));
				}
			}
		}

		// Token: 0x06010585 RID: 66949 RVA: 0x003F8EA8 File Offset: 0x003F70A8
		public override void RegisterEvent()
		{
			base.RegisterEvent();
			int num = 0;
			while ((long)num < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
			{
				this.m_buttons[num].m_skill.RegisterPressEventHandler(new ButtonPressEventHandler(this.OnSkillCast));
				bool flag = this.m_buttons[num].m_add != null;
				if (flag)
				{
					this.m_buttons[num].m_add.ID = (ulong)((long)num);
					this.m_buttons[num].m_add.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAddClick));
					this.m_buttons[num].m_add.RegisterSpritePressEventHandler(new SpritePressEventHandler(this.OnAddPress));
				}
				bool flag2 = this.m_buttons[num].m_lock != null;
				if (flag2)
				{
					this.m_buttons[num].m_lock.ID = (ulong)((long)num);
					this.m_buttons[num].m_lock.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnLockClick));
				}
				num++;
			}
			this.m_buttons[0].m_skill.RegisterPressEventHandler(new ButtonPressEventHandler(this.OnAttackPressed));
		}

		// Token: 0x06010586 RID: 66950 RVA: 0x003F8FF0 File Offset: 0x003F71F0
		public override void OnUnload()
		{
			bool flag = this._addFx != null;
			if (flag)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._addFx, true);
			}
			bool flag2 = this._skillFx != null;
			if (flag2)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._skillFx, true);
			}
			bool flag3 = this._moveFx != null;
			if (flag3)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._moveFx, true);
			}
			this._doc.BattleView = null;
			XSingleton<XTimerMgr>.singleton.KillTimer(this._fxDelayToken);
			XSingleton<XTimerMgr>.singleton.KillTimer(this._fxDelayDelToken);
			base.OnUnload();
		}

		// Token: 0x06010587 RID: 66951 RVA: 0x003F9094 File Offset: 0x003F7294
		protected override void OnShow()
		{
			base.OnShow();
			this.bNormalAttackPressed = false;
			bool flag = XSingleton<XScene>.singleton.SceneType != SceneType.SCENE_HEROBATTLE;
			if (flag)
			{
				this.ResetSkill(false, false);
			}
		}

		// Token: 0x06010588 RID: 66952 RVA: 0x003F90D0 File Offset: 0x003F72D0
		public void SetButtonNum(int num)
		{
			bool flag = this._showSkillNum == num;
			if (!flag)
			{
				this._showSkillNum = num;
				int group = 0;
				bool flag2 = num != 0;
				if (flag2)
				{
					group = 5 - num;
				}
				int num2 = 2;
				while (num2 <= 5 && num2 < this.m_buttons.Length)
				{
					IXPositionGroup ixpositionGroup = this.m_buttons[num2].m_skill.gameObject.GetComponent("PositionGroup") as IXPositionGroup;
					ixpositionGroup.SetGroup(group);
					num2++;
				}
			}
		}

		// Token: 0x06010589 RID: 66953 RVA: 0x003F9154 File Offset: 0x003F7354
		public void SetupSkillMobaLevel()
		{
			bool flag = XSingleton<XEntityMgr>.singleton.Player == null || XSingleton<XEntityMgr>.singleton.Player.Transformer == null;
			if (!flag)
			{
				this.m_LevelPool.ReturnAll(true);
				bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA;
				if (flag2)
				{
					int i = 2;
					while (i <= 5)
					{
						bool flag3 = i < XSingleton<XEntityMgr>.singleton.Player.SkillSlot.Length && i < this.m_buttons.Length;
						if (flag3)
						{
							int skillMaxLevel = XSingleton<XSkillEffectMgr>.singleton.GetSkillMaxLevel(XSingleton<XEntityMgr>.singleton.Player.SkillSlot[i], XSingleton<XEntityMgr>.singleton.Player.SkillCasterTypeID);
							bool flag4 = skillMaxLevel <= 1;
							if (!flag4)
							{
								Transform parent = this.m_buttons[i].m_skillLevel.gameObject.transform.Find("p");
								for (int j = 0; j < skillMaxLevel; j++)
								{
									float num = (float)j * 2f * 3.1415927f / (float)skillMaxLevel;
									GameObject gameObject = this.m_LevelPool.FetchGameObject(false);
									gameObject.transform.parent = parent;
									gameObject.transform.localScale = Vector3.one;
									gameObject.transform.localPosition = new Vector3(Mathf.Sin(num) * 40f, Mathf.Cos(num) * 40f);
									gameObject.transform.eulerAngles = new Vector3(0f, 0f, -num * 57.29578f);
								}
								this.m_buttons[i].m_skillMaxLevel = skillMaxLevel;
							}
						}
						//IL_1AF:
						i++;
						continue;
						//goto IL_1AF;
					}
				}
				else
				{
					int skillMaxLevel2 = XSingleton<XSkillEffectMgr>.singleton.GetSkillMaxLevel(XSingleton<XEntityMgr>.singleton.Player.SkillSlot[0], XSingleton<XEntityMgr>.singleton.Player.SkillCasterTypeID);
					Transform parent2 = this.m_buttons[0].m_skillLevel.gameObject.transform.Find("p");
					for (int k = 0; k < skillMaxLevel2; k++)
					{
						float num2 = (float)k * 2f * 3.1415927f / (float)skillMaxLevel2;
						GameObject gameObject2 = this.m_LevelPool.FetchGameObject(false);
						gameObject2.transform.parent = parent2;
						gameObject2.transform.localScale = Vector3.one;
						gameObject2.transform.localPosition = new Vector3(Mathf.Sin(num2) * 64f, Mathf.Cos(num2) * 64f);
						gameObject2.transform.eulerAngles = new Vector3(0f, 0f, -num2 * 57.29578f);
					}
					this.m_buttons[0].m_skillMaxLevel = skillMaxLevel2;
					this.SetMobaSkillLevel(0, false);
				}
			}
		}

		// Token: 0x0601058A RID: 66954 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		private void _SetAttackGlow(bool bActive)
		{
		}

		// Token: 0x0601058B RID: 66955 RVA: 0x003F944F File Offset: 0x003F764F
		public void ResetPressState()
		{
			this.bNormalAttackPressed = false;
			this.m_buttons[0].m_skill.ResetState();
			this._SetAttackGlow(false);
		}

		// Token: 0x0601058C RID: 66956 RVA: 0x003F9478 File Offset: 0x003F7678
		public void BindSkill(int idx, uint skill, bool rebind = false)
		{
			bool flag = (long)idx >= (long)((ulong)XBattleSkillDocument.Total_skill_slot) || (!rebind && skill == this.m_buttons[idx].m_skillId);
			if (flag)
			{
				bool flag2 = skill == 0U && this.m_buttons[idx].m_lock != null;
				if (flag2)
				{
					uint level = XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
					uint skillSlotUnLockLevel = this._skill_doc.GetSkillSlotUnLockLevel(idx);
					this.m_buttons[idx].SetButton(this._ShouldShowButton(skill, idx));
					bool flag3 = level < skillSlotUnLockLevel;
					if (flag3)
					{
						this.m_buttons[idx].m_lock.gameObject.SetActive(true);
					}
					else
					{
						this.m_buttons[idx].m_lock.gameObject.SetActive(false);
					}
				}
			}
			else
			{
				bool flag4 = !this.m_buttons[idx].Active;
				if (!flag4)
				{
					bool flag5 = skill > 0U;
					if (flag5)
					{
						uint skillLevel = XSingleton<XEntityMgr>.singleton.Player.Skill.IsSkillReplaced ? 1U : XSingleton<XEntityMgr>.singleton.Player.Attributes.SkillLevelInfo.GetSkillLevel(skill);
						SkillList.RowData skillConfig = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(skill, skillLevel, XSingleton<XEntityMgr>.singleton.Player.SkillCasterTypeID);
						bool flag6 = skillConfig != null;
						if (flag6)
						{
							this.m_buttons[idx].m_skillCost = XSingleton<XEntityMgr>.singleton.Player.SkillMgr.GetMPCost(skill);
							this.m_buttons[idx].m_skillId = skill;
							this.m_buttons[idx].m_skillIcon.SetSprite(skillConfig.Icon, skillConfig.Atlas, false);
							bool flag7 = this.m_buttons[idx].m_lock != null;
							if (flag7)
							{
								this.m_buttons[idx].m_lock.gameObject.SetActive(false);
							}
						}
						else
						{
							this.m_buttons[idx].m_skillId = 0U;
							this.m_buttons[idx].m_skillIcon.spriteName = "";
							this.m_buttons[idx].SetButtonStatus(false);
						}
					}
					else
					{
						this.m_buttons[idx].m_skillId = 0U;
						this.m_buttons[idx].m_skillIcon.spriteName = "";
						this.m_buttons[idx].SetButtonStatus(false);
					}
				}
			}
		}

		// Token: 0x0601058D RID: 66957 RVA: 0x003F9710 File Offset: 0x003F7910
		public void OnSetOptionsValue()
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			int awakeSkillSlot = XSkillTreeDocument.AwakeSkillSlot;
			bool flag = awakeSkillSlot < this.m_buttons.Length && awakeSkillSlot < XSingleton<XEntityMgr>.singleton.Player.SkillSlot.Length;
			if (flag)
			{
				this.m_buttons[awakeSkillSlot].SetButton(sceneData.ShowSkill && this._ShouldShowButton(XSingleton<XEntityMgr>.singleton.Player.SkillSlot[awakeSkillSlot], awakeSkillSlot));
			}
		}

		// Token: 0x0601058E RID: 66958 RVA: 0x003F9794 File Offset: 0x003F7994
		private bool IsAwakeSkillSlotNeedOpen()
		{
			return this._skill_doc.IsAwakeSkillSlotOpen && this._skill_doc.IsSelfAwaked && this.IsAwakeSlotSettingOn;
		}

		// Token: 0x0601058F RID: 66959 RVA: 0x003F97CC File Offset: 0x003F79CC
		private bool _ShouldShowButton(uint skillID, int idx)
		{
			bool flag = idx == XSkillTreeDocument.AwakeSkillSlot && !this.IsAwakeSkillSlotNeedOpen();
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = skillID > 0U;
				if (flag2)
				{
					result = true;
				}
				else
				{
					bool flag3 = XSingleton<XEntityMgr>.singleton.Player.IsTransform || XSingleton<XEntityMgr>.singleton.Player.Skill.IsSkillReplaced;
					if (flag3)
					{
						result = false;
					}
					else
					{
						SkillTypeEnum skillSlotType = this._skill_doc.GetSkillSlotType(idx);
						result = (skillSlotType != SkillTypeEnum.Skill_Buff || this._skill_doc.GetSkillSlotUnLockLevel(XFastEnumIntEqualityComparer<XSkillSlot>.ToInt(XSkillSlot.Skill_1_Buff)) <= XSingleton<XAttributeMgr>.singleton.XPlayerData.Level);
					}
				}
			}
			return result;
		}

		// Token: 0x06010590 RID: 66960 RVA: 0x003F9870 File Offset: 0x003F7A70
		public void ResetSkill(bool showfx = false, bool rebind = false)
		{
			int num = 0;
			while ((long)num < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
			{
				this.ResetSkill(num, rebind);
				bool flag = showfx && this.m_buttons[num].m_skillId > 0U;
				if (flag)
				{
					this.PlayShowSkillFx(num);
				}
				this.m_buttons[num].SetButton(this._ShouldShowButton(this.m_buttons[num].m_skillId, num));
				num++;
			}
			bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB;
			if (flag2)
			{
				DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.SetupSkillMobaLevel();
				int num2 = 0;
				while ((long)num2 < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
				{
					uint num3;
					bool flag3 = XBattleSkillDocument.SkillLevelDict.TryGetValue(this.m_buttons[num2].m_skillId, out num3);
					if (flag3)
					{
						XBattleSkillDocument.SkillLevel[num2] = (int)num3;
						DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.SetMobaSkillLevel(num2, false);
					}
					num2++;
				}
				bool flag4 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA;
				if (flag4)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.SkillHandler.RefreshAddBtn(null);
				}
			}
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag5 = !sceneData.ShowSkill;
			if (flag5)
			{
				int num4 = 1;
				while ((long)num4 < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
				{
					this.m_buttons[num4].SetButton(false);
					num4++;
				}
			}
			bool flag6 = !sceneData.ShowNormalAttack;
			if (flag6)
			{
				this.m_buttons[0].SetButton(false);
			}
		}

		// Token: 0x06010591 RID: 66961 RVA: 0x003F9A2C File Offset: 0x003F7C2C
		public void ResetSkill(int idx, bool rebind = false)
		{
			bool flag = idx < XSingleton<XEntityMgr>.singleton.Player.SkillSlot.Length;
			if (flag)
			{
				this.BindSkill(idx, XSingleton<XEntityMgr>.singleton.Player.SkillSlot[idx], rebind);
				this.m_buttons[idx].SetButtonHighlight(false);
				this.m_buttons[idx].SetButtonInRange(false);
			}
			else
			{
				XSingleton<XDebug>.singleton.AddWarningLog("skill slot ", idx.ToString(), "missing...", null, null, null);
				//XSingleton<XDebug>.singleton.AddErrorLog("skill slot ", idx.ToString(), "missing...", null, null, null);
			}
		}

		// Token: 0x06010592 RID: 66962 RVA: 0x003F9AB8 File Offset: 0x003F7CB8
		public void CoolDownSkillAll()
		{
			int num = 0;
			while ((long)num < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
			{
				bool flag = this.m_buttons[num].m_skillId > 0U;
				if (flag)
				{
					XSkillCore skill = XSingleton<XEntityMgr>.singleton.Player.SkillMgr.GetSkill(this.m_buttons[num].m_skillId);
					bool flag2 = skill != null;
					if (flag2)
					{
						skill.CoolDown();
					}
					this.PlayShowSkillFx(num);
				}
				num++;
			}
		}

		// Token: 0x06010593 RID: 66963 RVA: 0x003F9B38 File Offset: 0x003F7D38
		public void MakeCoolDownAtLaunch()
		{
			int num = 0;
			while ((long)num < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
			{
				bool flag = this.m_buttons[num].m_skillId > 0U;
				if (flag)
				{
					XSkillCore skill = XSingleton<XEntityMgr>.singleton.Player.SkillMgr.GetSkill(this.m_buttons[num].m_skillId);
					bool flag2 = skill != null;
					if (flag2)
					{
						skill.MakeCoolDownAtLaunch();
					}
				}
				num++;
			}
		}

		// Token: 0x06010594 RID: 66964 RVA: 0x003F9BAF File Offset: 0x003F7DAF
		public void DisableSkill(int idx)
		{
			this.BindSkill(idx, 0U, false);
			this.m_buttons[idx].Active = false;
			this.m_buttons[idx].SetButton(false);
		}

		// Token: 0x06010595 RID: 66965 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		public void ShowSkillSlot(int index)
		{
		}

		// Token: 0x06010596 RID: 66966 RVA: 0x003F9BE4 File Offset: 0x003F7DE4
		public void EnableSkill(int idx)
		{
			this.m_buttons[idx].Active = true;
			this.m_buttons[idx].SetButton(true);
			bool flag = idx < XSingleton<XEntityMgr>.singleton.Player.SkillSlot.Length;
			if (flag)
			{
				this.BindSkill(idx, XSingleton<XEntityMgr>.singleton.Player.SkillSlot[idx], false);
				this.PlayShowSkillFx(idx);
			}
			else
			{
				XSingleton<XDebug>.singleton.AddErrorLog("skill slot ", idx.ToString(), "missing...", null, null, null);
			}
		}

		// Token: 0x06010597 RID: 66967 RVA: 0x003F9C74 File Offset: 0x003F7E74
		public void AlwaysHot(int idx, bool isHot)
		{
			this.m_buttons[idx].AlwaysHot = isHot;
			this.m_buttons[idx].SetButtonStatus(true);
		}

		// Token: 0x06010598 RID: 66968 RVA: 0x003F944F File Offset: 0x003F764F
		public void OnDeath()
		{
			this.bNormalAttackPressed = false;
			this.m_buttons[0].m_skill.ResetState();
			this._SetAttackGlow(false);
		}

		// Token: 0x06010599 RID: 66969 RVA: 0x003F9C9C File Offset: 0x003F7E9C
		public override void OnUpdate()
		{
			base.OnUpdate();
			bool flag = this.bNormalAttackPressed;
			if (flag)
			{
				this.CastNormalAttack();
			}
			bool flag2 = !DlgBase<DemoUI, DemoUIBehaviour>.singleton.IsMainUIVisible();
			if (flag2)
			{
				this.UpdateKeyBoard();
			}
			this.UpdateGameSirControl();
			this.UpdateSkillInfo();
		}

		// Token: 0x0601059A RID: 66970 RVA: 0x003F9CEC File Offset: 0x003F7EEC
		protected void DestroyShowSkillFx(object o)
		{
			GameObject o2 = o as GameObject;
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroy(o2, true, false);
		}

		// Token: 0x0601059B RID: 66971 RVA: 0x003F9D0F File Offset: 0x003F7F0F
		public void OnAttackPressed(bool state)
		{
			this.OnAttackPressed(null, state);
		}

		// Token: 0x0601059C RID: 66972 RVA: 0x003F9D1C File Offset: 0x003F7F1C
		private void OnAttackPressed(IXUIButton go, bool state)
		{
			this.bNormalAttackPressed = state;
			bool flag = !state;
			if (!flag)
			{
				this._doc.OnSlotClicked(0);
			}
		}

		// Token: 0x0601059D RID: 66973 RVA: 0x003F9D48 File Offset: 0x003F7F48
		private void CastNormalAttack()
		{
			this.ImpCast(0);
		}

		// Token: 0x0601059E RID: 66974 RVA: 0x003F9D54 File Offset: 0x003F7F54
		private void OnSkillCast(IXUIButton go, bool state)
		{
			if (state)
			{
				this._doc.OnSlotClicked((int)go.ID);
				this.ImpCast((int)go.ID);
			}
		}

		// Token: 0x0601059F RID: 66975 RVA: 0x003F9D90 File Offset: 0x003F7F90
		private void OnLockClick(IXUISprite sp)
		{
			int slotid = (int)sp.ID;
			uint skillSlotUnLockLevel = this._skill_doc.GetSkillSlotUnLockLevel(slotid);
			string text = string.Format(XStringDefineProxy.GetString("OpenSkillAtLevel"), skillSlotUnLockLevel);
			XSingleton<UiUtility>.singleton.ShowSystemNoticeTip(text);
		}

		// Token: 0x060105A0 RID: 66976 RVA: 0x003F9DD8 File Offset: 0x003F7FD8
		public void OnAddClick(IXUISprite sp)
		{
			bool flag = this._pressTime > 1f;
			if (!flag)
			{
				bool flag2 = (int)sp.ID >= this.m_buttons.Length;
				if (!flag2)
				{
					XMobaBattleDocument specificDocument = XDocuments.GetSpecificDocument<XMobaBattleDocument>(XMobaBattleDocument.uuID);
					bool flag3 = this.IsSkillCanLevelUp((int)sp.ID);
					if (flag3)
					{
						specificDocument.QuerySkillLevelUp(this.m_buttons[(int)sp.ID].m_skillId);
					}
				}
			}
		}

		// Token: 0x060105A1 RID: 66977 RVA: 0x003F9E50 File Offset: 0x003F8050
		public void SetMobaSkillLevel(int slot, bool isLevelUp)
		{
			bool flag = isLevelUp && this.m_buttons[slot].m_add != null;
			if (flag)
			{
				bool flag2 = this._addFx != null;
				if (flag2)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._addFx, true);
				}
				bool flag3 = this._skillFx != null;
				if (flag3)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._skillFx, true);
				}
				bool flag4 = this._moveFx != null;
				if (flag4)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(this._moveFx, true);
				}
				Transform transform = this.m_buttons[slot].m_skillIcon.transform;
				Transform transform2 = this.m_buttons[slot].m_add.transform.parent.Find("Fx");
				this._addFx = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_jiahao", transform2, false);
				this._skillFx = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_jinenglan", transform, false);
				this._moveFx = XSingleton<XFxMgr>.singleton.CreateUIFx("Effects/FX_Particle/UIfx/UI_yxxg_feixing", transform2, false);
				this._addFx.Play();
				this._skillFx.Play();
				Vector3 vector = transform.position - transform2.position;
				float num = Vector3.Angle(Vector3.right, vector);
				bool flag5 = vector.y < 0f;
				if (flag5)
				{
					num = -num;
				}
				this._moveFx.Play(transform2.transform.position, Quaternion.Euler(0f, 0f, num), Vector3.one, 1f);
			}
			this.m_buttons[slot].SetSkillLevel(XBattleSkillDocument.SkillLevel[slot]);
		}

		// Token: 0x060105A2 RID: 66978 RVA: 0x003FA000 File Offset: 0x003F8200
		public void DelayRefreshAddBtn()
		{
			XSingleton<XTimerMgr>.singleton.KillTimer(this._fxDelayToken);
			this._fxDelayToken = XSingleton<XTimerMgr>.singleton.SetTimer(0.1f, new XTimerMgr.ElapsedEventHandler(this.RefreshAddBtn), null);
			XSingleton<XTimerMgr>.singleton.KillTimer(this._fxDelayDelToken);
			this._fxDelayDelToken = XSingleton<XTimerMgr>.singleton.SetTimer(2f, new XTimerMgr.ElapsedEventHandler(this.DelayRefreshFx), null);
		}

		// Token: 0x060105A3 RID: 66979 RVA: 0x003FA074 File Offset: 0x003F8274
		public void DelayRefreshFx(object o = null)
		{
			bool flag = this._addFx != null;
			if (flag)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._addFx, true);
			}
			bool flag2 = this._skillFx != null;
			if (flag2)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._skillFx, true);
			}
			bool flag3 = this._moveFx != null;
			if (flag3)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this._moveFx, true);
			}
			this._addFx = null;
			this._skillFx = null;
			this._moveFx = null;
		}

		// Token: 0x060105A4 RID: 66980 RVA: 0x003FA0F4 File Offset: 0x003F82F4
		public void RefreshAddBtn(object o = null)
		{
			bool flag = XBattleSkillDocument.Total_skill_slot <= 5U || XSingleton<XEntityMgr>.singleton.Player == null;
			if (!flag)
			{
				bool flag2 = !XEntity.ValideEntity(XSingleton<XEntityMgr>.singleton.Player.Transformer);
				if (!flag2)
				{
					XMobaBattleDocument specificDocument = XDocuments.GetSpecificDocument<XMobaBattleDocument>(XMobaBattleDocument.uuID);
					int skillPoint = specificDocument.SkillPoint;
					for (int i = 2; i <= 5; i++)
					{
						this.m_buttons[i].m_add.SetVisible(this.IsSkillCanLevelUp(i));
					}
				}
			}
		}

		// Token: 0x060105A5 RID: 66981 RVA: 0x003FA188 File Offset: 0x003F8388
		public bool IsSkillCanLevelUp(int index)
		{
			bool flag = XBattleSkillDocument.Total_skill_slot <= 5U || XSingleton<XEntityMgr>.singleton.Player == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				XMobaBattleDocument specificDocument = XDocuments.GetSpecificDocument<XMobaBattleDocument>(XMobaBattleDocument.uuID);
				bool flag2 = specificDocument.SkillPoint == 0;
				if (flag2)
				{
					result = false;
				}
				else
				{
					int skillMaxLevel = XSingleton<XSkillEffectMgr>.singleton.GetSkillMaxLevel(this.m_buttons[index].m_skillId, XSingleton<XEntityMgr>.singleton.Player.SkillCasterTypeID);
					bool flag3 = XBattleSkillDocument.SkillLevel[index] >= skillMaxLevel;
					if (flag3)
					{
						result = false;
					}
					else
					{
						SkillList.RowData skillConfig = XSingleton<XSkillEffectMgr>.singleton.GetSkillConfig(this.m_buttons[index].m_skillId, (uint)(XBattleSkillDocument.SkillLevel[index] + 1), XSingleton<XEntityMgr>.singleton.Player.SkillCasterTypeID);
						bool flag4 = skillConfig == null || XBattleSkillDocument.SkillLevel[index] >= skillConfig.UpReqRoleLevel.Length || (int)skillConfig.UpReqRoleLevel[XBattleSkillDocument.SkillLevel[index]] > specificDocument.MyLevel();
						result = !flag4;
					}
				}
			}
			return result;
		}

		// Token: 0x060105A6 RID: 66982 RVA: 0x003FA294 File Offset: 0x003F8494
		public bool OnAddPress(IXUISprite sp, bool state)
		{
			bool flag = (int)sp.ID >= this.m_buttons.Length;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				if (state)
				{
					this._pressTime = Time.time;
				}
				else
				{
					this._pressTime = Time.time - this._pressTime;
				}
				bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_MobaBattleHandler != null;
				if (flag2)
				{
					DlgBase<BattleMain, BattleMainBehaviour>.singleton.m_MobaBattleHandler.ShowSkillTips(state, this.m_buttons[(int)sp.ID].m_skillId, XBattleSkillDocument.SkillLevel[(int)sp.ID] + 1);
				}
				result = true;
			}
			return result;
		}

		// Token: 0x060105A7 RID: 66983 RVA: 0x003FA330 File Offset: 0x003F8530
		private void ImpCast(int idx)
		{
			//bool flag = this.m_buttons[idx].m_skillId == 0U || !this.m_buttons[idx].Enabled || !this.m_buttons[idx].Visible;
			if (this.m_buttons[idx].m_skillId>0 && this.m_buttons[idx].Enabled && this.m_buttons[idx].Visible)
			{
				uint num = this._doc.NextJASkillBaseOnCurrent();
				//bool flag2 = num == this.m_buttons[idx].m_skillId;
				XSingleton<XDebug>.singleton.AddWarningLog("zcg ===== ImpCast ===== num: " + num + " button idx: " + idx + " skillid: " + this.m_buttons[idx].m_skillId + " SyncMode:" + (XSingleton<XGame>.singleton.SyncMode ? "True" : "False"));
				if (num == this.m_buttons[idx].m_skillId)
				{
					//bool flag3 = this._doc.IsInQTEChain(num);
					if (this._doc.IsInQTEChain(num))
					{
						this._doc.CastSkill(this.m_buttons[idx]);
					}
					else
					{
						bool syncMode = XSingleton<XGame>.singleton.SyncMode;
						if (syncMode)
						{
							this._doc.FireSkillEvent(idx);
						}
						else
						{
							this.LastAttackTime = Time.time;
						}
					}
				}
				else
				{
					this._doc.CastSkill(this.m_buttons[idx]);
				}
			}
		}

		// Token: 0x060105A8 RID: 66984 RVA: 0x003FA420 File Offset: 0x003F8620
		protected void UpdateSkillInfo()
		{
			XPlayer player = XSingleton<XEntityMgr>.singleton.Player;
			bool flag = player == null;
			if (!flag)
			{
				int num = (int)XSingleton<XEntityMgr>.singleton.Player.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentMP_Basic);
				int num2 = 0;
				while ((long)num2 < (long)((ulong)XBattleSkillDocument.Total_skill_slot))
				{
					XSkillCore xskillCore = this._doc.HasReplaced(this.m_buttons[num2].m_skillId);
					bool flag2 = xskillCore != null;
					if (flag2)
					{
						bool showRunningTime = xskillCore.ShowRunningTime;
						if (showRunningTime)
						{
							bool flag3 = this.m_buttons[num2].m_Times != null;
							if (flag3)
							{
								bool flag4 = xskillCore.LeftRunningTime != 0;
								bool flag5 = this.m_buttons[num2].m_TimesVis != flag4;
								if (flag5)
								{
									this.m_buttons[num2].m_TimesVis = flag4;
									this.m_buttons[num2].m_Times.gameObject.transform.localPosition = (flag4 ? new Vector3(24f, -30f) : XGameUI.Far_Far_Away);
								}
								this.m_buttons[num2].m_Times.SetText(xskillCore.LeftRunningTime.ToString());
							}
						}
						else
						{
							bool flag6 = this.m_buttons[num2].m_Times != null;
							if (flag6)
							{
								bool timesVis = this.m_buttons[num2].m_TimesVis;
								if (timesVis)
								{
									this.m_buttons[num2].m_TimesVis = false;
									this.m_buttons[num2].m_Times.gameObject.transform.localPosition = XGameUI.Far_Far_Away;
								}
							}
						}
						bool reloading = xskillCore.Reloading;
						if (reloading)
						{
							float coolDown = xskillCore.GetCoolDown();
							float elapsedCD = xskillCore.GetElapsedCD();
							float num3 = (coolDown > 0f) ? (1f - elapsedCD / coolDown) : 0f;
							bool flag7 = num2 > 0 || !XSingleton<XEntityMgr>.singleton.Player.SkillMgr.IsPhysicalAttack(xskillCore.ID);
							this.m_buttons[num2].m_skillCD.value = (flag7 ? num3 : 0f);
							bool cooledDown = xskillCore.CooledDown;
							if (cooledDown)
							{
								this.m_buttons[num2].SetCDText(false);
							}
							else
							{
								this.m_buttons[num2].SetCDText(true);
								float num4 = coolDown - elapsedCD;
								bool flag8 = num4 >= 1f;
								if (flag8)
								{
									int num5 = (int)(coolDown - elapsedCD + 0.5f);
									bool flag9 = this.m_buttons[num2].m_skillCDText.HasIdentityChanged(num5);
									if (flag9)
									{
										string text = flag7 ? num5.ToString() : "";
										this.m_buttons[num2].m_skillCDText.SetText(text);
										this.m_buttons[num2].m_skillCDText.SetIdentity(num5);
									}
								}
								else
								{
									int num6 = (int)(num4 * 10f);
									bool flag10 = this.m_buttons[num2].m_skillCDText.HasIdentityChanged(num6);
									if (flag10)
									{
										string text = flag7 ? num4.ToString("F1") : "";
										this.m_buttons[num2].m_skillCDText.SetText(text);
										this.m_buttons[num2].m_skillCDText.SetIdentity(num6);
									}
								}
							}
						}
						else
						{
							this.m_buttons[num2].SetCDText(false);
							this.m_buttons[num2].m_skillCD.value = 0f;
						}
						bool flag11 = this._doc.CanCast(xskillCore.ID, num2);
						if (flag11)
						{
							this.m_buttons[num2].SetButtonStatus(true);
							this.m_buttons[num2].SetNoMP((float)num < this.m_buttons[num2].m_skillCost);
							bool flag12 = num2 > 1;
							if (flag12)
							{
								this.m_buttons[num2].SetButtonInRange(xskillCore.CooledDown && this._doc.CanFind(xskillCore.ID));
							}
						}
						else
						{
							bool alwaysHot = this.m_buttons[num2].AlwaysHot;
							if (alwaysHot)
							{
								this.m_buttons[num2].SetButtonStatus(true);
							}
							else
							{
								bool flag13 = num2 > 1;
								if (flag13)
								{
									this.m_buttons[num2].SetButtonInRange(false);
								}
								this.m_buttons[num2].SetButtonStatus(false);
							}
						}
					}
					else
					{
						this.m_buttons[num2].m_skillCD.value = 0f;
						this.m_buttons[num2].SetCDText(false);
						this.m_buttons[num2].SetButtonStatus(false);
					}
					num2++;
				}
			}
		}

		// Token: 0x060105A9 RID: 66985 RVA: 0x003FA934 File Offset: 0x003F8B34
		public void UpdateQTESkill(int idx, uint skill)
		{
			bool flag = skill > 0U;
			if (flag)
			{
				this.BindSkill(idx, skill, false);
				bool flag2 = !XSingleton<XEntityMgr>.singleton.Player.QTE.IsInIgnorePresentState();
				if (flag2)
				{
					this.m_buttons[idx].SetButtonHighlight(true);
				}
			}
		}

		// Token: 0x060105AA RID: 66986 RVA: 0x003FA984 File Offset: 0x003F8B84
		private void PlayShowSkillFx(int idx)
		{
			this.m_buttons[idx].SetButtonStatus(true);
			GameObject gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab("UI/Common/ShowSkillFx", true, false) as GameObject;
			Transform transform = this.m_buttons[idx].m_skill.gameObject.transform.Find("icon");
			bool flag = transform == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("Skill Icon No Find", null, null, null, null, null);
			}
			else
			{
				XSingleton<UiUtility>.singleton.AddChild(transform.gameObject, gameObject);
				IXUISprite ixuisprite = gameObject.GetComponent("XUISprite") as IXUISprite;
				ixuisprite.ResetAnimationAndPlay();
				XSingleton<XTimerMgr>.singleton.SetTimer(5f, this._DestroyShowSkillFx, gameObject);
			}
		}

		// Token: 0x060105AB RID: 66987 RVA: 0x003FAA48 File Offset: 0x003F8C48
		private bool ExcuteSkill(int index, string[] skillNames)
		{
			bool flag = skillNames == null || skillNames.Length == 0;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = true;
				int i = 0;
				int num = skillNames.Length;
				while (i < num)
				{
					flag2 = (flag2 && this.m_sirControl.GetButton(skillNames[i]));
					bool flag3 = !flag2;
					if (flag3)
					{
						break;
					}
					i++;
				}
				bool flag4 = flag2;
				if (flag4)
				{
					bool flag5 = index == 0;
					if (flag5)
					{
						this.CastNormalAttack();
					}
					else
					{
						this.ImpCast(index);
					}
				}
				result = flag2;
			}
			return result;
		}

		// Token: 0x060105AC RID: 66988 RVA: 0x003FAAD0 File Offset: 0x003F8CD0
		private void UpdateGameSirControl()
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				bool flag2 = this.m_sirControl == null || !this.m_sirControl.IsConnected() || this.mSkillSets == null;
				if (!flag2)
				{
					bool flag3 = this.mSkillSize == 0;
					if (!flag3)
					{
						for (int i = 0; i < this.mSkillSize; i++)
						{
							this.ExcuteSkill(i, this.mSkillSets[i]);
						}
					}
				}
			}
		}

		// Token: 0x060105AD RID: 66989 RVA: 0x003FAB50 File Offset: 0x003F8D50
		public void UpdateKeyBoard()
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				bool keyDown = Input.GetKeyDown(KeyCode.H);
				if (keyDown)
				{
					this.CastNormalAttack();
				}
				bool keyDown2 = Input.GetKeyDown(KeyCode.Space);
				if (keyDown2)
				{
					this.ImpCast(1);
				}
				bool keyDown3 = Input.GetKeyDown(KeyCode.J);
				if (keyDown3)
				{
					this.ImpCast(2);
				}
				bool keyDown4 = Input.GetKeyDown(KeyCode.K);
				if (keyDown4)
				{
					this.ImpCast(3);
				}
				bool keyDown5 = Input.GetKeyDown(KeyCode.L);
				if (keyDown5)
				{
					this.ImpCast(4);
				}
				bool keyDown6 = Input.GetKeyDown(KeyCode.Semicolon);
				if (keyDown6)
				{
					this.ImpCast(5);
				}
				bool keyDown7 = Input.GetKeyDown(KeyCode.U);
				if (keyDown7)
				{
					this.ImpCast(6);
				}
				bool keyDown8 = Input.GetKeyDown(KeyCode.O);
				if (keyDown8)
				{
					this.ImpCast(7);
				}
				bool keyDown9 = Input.GetKeyDown(KeyCode.P);
				if (keyDown9)
				{
					this.ImpCast(8);
				}
				bool keyDown10 = Input.GetKeyDown(KeyCode.I);
				if (keyDown10)
				{
					this.ImpCast(9);
				}
			}
		}

		// Token: 0x040075D2 RID: 30162
		private BattleSkillHandler.XSkillButton[] m_buttons = null;

		// Token: 0x040075D3 RID: 30163
		private XBattleSkillDocument _doc = null;

		// Token: 0x040075D4 RID: 30164
		private XSkillTreeDocument _skill_doc = null;

		// Token: 0x040075D5 RID: 30165
		public float LastAttackTime = 0f;

		// Token: 0x040075D6 RID: 30166
		private bool bNormalAttackPressed = false;

		// Token: 0x040075D7 RID: 30167
		private XTimerMgr.ElapsedEventHandler _DestroyShowSkillFx = null;

		// Token: 0x040075D8 RID: 30168
		private IXGameSirControl m_sirControl;

		// Token: 0x040075D9 RID: 30169
		private List<string[]> mSkillSets;

		// Token: 0x040075DA RID: 30170
		private int mSkillSize = 0;

		// Token: 0x040075DB RID: 30171
		private XFx _addFx;

		// Token: 0x040075DC RID: 30172
		private XFx _skillFx;

		// Token: 0x040075DD RID: 30173
		private XFx _moveFx;

		// Token: 0x040075DE RID: 30174
		private int _showSkillNum;

		// Token: 0x040075DF RID: 30175
		private uint _fxDelayToken;

		// Token: 0x040075E0 RID: 30176
		private uint _fxDelayDelToken;

		// Token: 0x040075E1 RID: 30177
		private XUIPool m_LevelPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);

		// Token: 0x040075E2 RID: 30178
		private float _pressTime;

		// Token: 0x040075E3 RID: 30179
		private List<string>[] skillSet = new List<string>[10];

		// Token: 0x02001A19 RID: 6681
		public struct XSkillButton
		{
			// Token: 0x17003B77 RID: 15223
			// (get) Token: 0x06011133 RID: 69939 RVA: 0x00457E3C File Offset: 0x0045603C
			public bool Visible
			{
				get
				{
					return this.m_visible;
				}
			}

			// Token: 0x17003B78 RID: 15224
			// (get) Token: 0x06011134 RID: 69940 RVA: 0x00457E54 File Offset: 0x00456054
			public bool Enabled
			{
				get
				{
					return this.m_enabled;
				}
			}

			// Token: 0x06011135 RID: 69941 RVA: 0x00457E6C File Offset: 0x0045606C
			public XSkillButton(GameObject panelObject, int idx)
			{
				this.AlwaysHot = false;
				this.Active = true;
				this.m_visible = true;
				this.m_TimesVis = false;
				Transform transform = panelObject.transform.Find("Skill" + idx + "/Bg");
				this.m_OriginPos = transform.transform.localPosition;
				this.m_skill = (transform.GetComponent("XUIButton") as IXUIButton);
				this.m_skill.ID = (ulong)((long)idx);
				bool flag = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_MOBA && idx >= 2 && idx <= 5;
				if (flag)
				{
					Transform transform2 = transform.transform.parent.Find("Addsp");
					transform2.gameObject.SetActive(true);
					this.m_add = (transform2.GetComponent("XUISprite") as IXUISprite);
					transform2.gameObject.SetActive(false);
					transform2 = transform.transform.Find("level");
					transform2.gameObject.SetActive(true);
					this.m_skillLevel = (transform2.GetComponent("XUISprite") as IXUISprite);
					this.m_skillLevel.SetFillAmount(0f);
				}
				else
				{
					bool flag2 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB & idx == 0;
					if (flag2)
					{
						this.m_add = null;
						Transform transform3 = transform.transform.Find("level");
						transform3.gameObject.SetActive(true);
						this.m_skillLevel = (transform3.GetComponent("XUISprite") as IXUISprite);
						this.m_skillLevel.SetFillAmount(0f);
						transform3 = transform.transform.Find("icon/p");
						transform3.gameObject.SetActive(false);
					}
					else
					{
						bool flag3 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_SURVIVE && idx == 0;
						if (flag3)
						{
							this.m_add = null;
							this.m_skillLevel = null;
							Transform transform4 = transform.transform.Find("icon");
							Transform transform5 = transform.transform.Find("ChickenDinnerIcon");
							transform5.gameObject.SetActive(true);
							transform5.localPosition = XGameUI.Far_Far_Away;
							IXUISprite ixuisprite = transform4.GetComponent("XUISprite") as IXUISprite;
							IXUISprite ixuisprite2 = transform5.GetComponent("XUISprite") as IXUISprite;
							ixuisprite.spriteWidth = ixuisprite2.spriteWidth;
							ixuisprite.spriteHeight = ixuisprite2.spriteHeight;
							transform4.rotation = transform5.rotation;
						}
						else
						{
							this.m_add = null;
							this.m_skillLevel = null;
						}
					}
				}
				this.m_skillMaxLevel = 0;
				bool flag4 = (idx >= 2 && idx <= 6) || idx == XSkillTreeDocument.AwakeSkillSlot;
				if (flag4)
				{
					this.m_Times = (transform.transform.Find("icon/Times").GetComponent("XUILabel") as IXUILabel);
					this.m_Times.gameObject.transform.localPosition = XGameUI.Far_Far_Away;
				}
				else
				{
					this.m_Times = null;
				}
				this.m_skillIcon = (transform.transform.Find("icon").GetComponent("XUISprite") as IXUISprite);
				this.m_skillCD = (this.m_skillIcon.gameObject.GetComponent("XUIProgress") as IXUIProgress);
				this.m_skillCDOver = (this.m_skillIcon.transform.Find("cdover").GetComponent("XUIPlayTween") as IXUITweenTool);
				this.m_CDOverOriginPos = this.m_skillCDOver.gameObject.transform.localPosition;
				this.m_skillCDOver.gameObject.transform.localPosition = XGameUI.Far_Far_Away;
				this.m_skillCDText = (this.m_skillIcon.transform.Find("Text").GetComponent("XUILabel") as IXUILabel);
				this.m_skillNoMp = this.m_skillIcon.transform.Find("nomp").gameObject;
				this.m_skillHighlight = transform.transform.Find("highlight").gameObject;
				this.m_skillHighlight.transform.localPosition = XGameUI.Far_Far_Away;
				this.m_lock = null;
				Transform transform6 = transform.transform.Find("lock");
				bool flag5 = transform6 != null;
				if (flag5)
				{
					this.m_lock = (transform6.GetComponent("XUISprite") as IXUISprite);
					this.m_lock.gameObject.SetActive(false);
				}
				this.m_skillCost = 0f;
				this.m_skillId = 0U;
				this.m_enabled = true;
			}

			// Token: 0x06011136 RID: 69942 RVA: 0x004582F8 File Offset: 0x004564F8
			public void SetButtonStatus(bool enable)
			{
				bool flag = this.m_enabled != enable;
				if (flag)
				{
					if (enable)
					{
						this.m_skill.SetEnable(true, false);
					}
					else
					{
						this.m_skillNoMp.transform.localPosition = XGameUI.Far_Far_Away;
						this.m_skill.SetEnable(false, this.m_skill.ID == 0UL);
					}
				}
				this.m_enabled = enable;
			}

			// Token: 0x06011137 RID: 69943 RVA: 0x0045836A File Offset: 0x0045656A
			public void SetButtonHighlight(bool enable)
			{
				this.m_skillHighlight.transform.localPosition = (enable ? Vector3.zero : XGameUI.Far_Far_Away);
			}

			// Token: 0x06011138 RID: 69944 RVA: 0x000FEEFC File Offset: 0x000FD0FC
			public void SetButtonInRange(bool enable)
			{
			}

			// Token: 0x06011139 RID: 69945 RVA: 0x0045838D File Offset: 0x0045658D
			public void SetButton(bool active)
			{
				this.m_visible = active;
				this.m_skill.SetVisible(active);
			}

			// Token: 0x0601113A RID: 69946 RVA: 0x004583A4 File Offset: 0x004565A4
			public void SetCDText(bool active)
			{
				this.m_skillCDText.gameObject.transform.localPosition = (active ? Vector3.zero : XGameUI.Far_Far_Away);
			}

			// Token: 0x0601113B RID: 69947 RVA: 0x000FEEFC File Offset: 0x000FD0FC
			public void SetCDOver(bool active)
			{
			}

			// Token: 0x0601113C RID: 69948 RVA: 0x004583CC File Offset: 0x004565CC
			public void SetNoMP(bool active)
			{
				this.m_skillNoMp.gameObject.transform.localPosition = (active ? Vector3.zero : XGameUI.Far_Far_Away);
			}

			// Token: 0x0601113D RID: 69949 RVA: 0x004583F4 File Offset: 0x004565F4
			private void _OnCDOverFinished(IXUITweenTool tween)
			{
				this.SetCDOver(false);
			}

			// Token: 0x0601113E RID: 69950 RVA: 0x00458400 File Offset: 0x00456600
			public void SetSkillLevel(int level)
			{
				bool flag = this.m_skillLevel == null;
				if (!flag)
				{
					this.m_skillLevel.SetFillAmount((float)level * 1f / (float)this.m_skillMaxLevel);
				}
			}

			// Token: 0x04008248 RID: 33352
			public bool Active;

			// Token: 0x04008249 RID: 33353
			public bool AlwaysHot;

			// Token: 0x0400824A RID: 33354
			public IXUIButton m_skill;

			// Token: 0x0400824B RID: 33355
			public IXUISprite m_skillIcon;

			// Token: 0x0400824C RID: 33356
			public IXUIProgress m_skillCD;

			// Token: 0x0400824D RID: 33357
			public IXUITweenTool m_skillCDOver;

			// Token: 0x0400824E RID: 33358
			public GameObject m_skillNoMp;

			// Token: 0x0400824F RID: 33359
			public IXUILabel m_skillCDText;

			// Token: 0x04008250 RID: 33360
			public float m_skillCost;

			// Token: 0x04008251 RID: 33361
			public uint m_skillId;

			// Token: 0x04008252 RID: 33362
			public GameObject m_skillHighlight;

			// Token: 0x04008253 RID: 33363
			public IXUISprite m_lock;

			// Token: 0x04008254 RID: 33364
			public IXUISprite m_add;

			// Token: 0x04008255 RID: 33365
			public IXUISprite m_skillLevel;

			// Token: 0x04008256 RID: 33366
			public int m_skillMaxLevel;

			// Token: 0x04008257 RID: 33367
			public bool m_TimesVis;

			// Token: 0x04008258 RID: 33368
			public IXUILabel m_Times;

			// Token: 0x04008259 RID: 33369
			private bool m_enabled;

			// Token: 0x0400825A RID: 33370
			private bool m_visible;

			// Token: 0x0400825B RID: 33371
			private Vector3 m_OriginPos;

			// Token: 0x0400825C RID: 33372
			private Vector3 m_CDOverOriginPos;
		}
	}
}
